package Client.Control;

import org.jgroups.JChannel;
import org.jgroups.Message;
import org.jgroups.ReceiverAdapter;

public class MainClient {

	public static void main(String[] args) {
		JChannel channel;
		try {
			channel = new JChannel("/home/bela/udp.xml");
		
	      channel.setReceiver(new ReceiverAdapter() {
	          public void receive(Message msg) {
	              System.out.println("received msg from " + msg.getSrc() + ": " + msg.getObject());
	          }
	      });
	      channel.connect("MyCluster");
	     
			channel.send(new Message(null, "hello world"));
		
	      channel.close();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
